/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "area_indic")
@NamedQueries({@NamedQuery(name = "AreaIndic.findByAreCod", query = "SELECT a FROM AreaIndic a WHERE a.areCod = :areCod"), @NamedQuery(name = "AreaIndic.findByAreNombre", query = "SELECT a FROM AreaIndic a WHERE a.areNombre = :areNombre"), @NamedQuery(name = "AreaIndic.findByAreReferencia", query = "SELECT a FROM AreaIndic a WHERE a.areReferencia = :areReferencia")})
public class AreaIndic implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "ARE_COD", nullable = false)
    private Integer areCod;
    @Column(name = "ARE_NOMBRE", nullable = false)
    private String areNombre;
    @Column(name = "ARE_REFERENCIA")
    private String areReferencia;
    @OneToMany(mappedBy = "areCod")
    private Collection<IndicadorPregunta> indicadorPreguntaCollection;

    public AreaIndic() {
    }

    public AreaIndic(Integer areCod) {
        this.areCod = areCod;
    }

    public AreaIndic(Integer areCod, String areNombre) {
        this.areCod = areCod;
        this.areNombre = areNombre;
    }

    public Integer getAreCod() {
        return areCod;
    }

    public void setAreCod(Integer areCod) {
        this.areCod = areCod;
    }

    public String getAreNombre() {
        return areNombre;
    }

    public void setAreNombre(String areNombre) {
        this.areNombre = areNombre;
    }

    public String getAreReferencia() {
        return areReferencia;
    }

    public void setAreReferencia(String areReferencia) {
        this.areReferencia = areReferencia;
    }

    public Collection<IndicadorPregunta> getIndicadorPreguntaCollection() {
        return indicadorPreguntaCollection;
    }

    public void setIndicadorPreguntaCollection(Collection<IndicadorPregunta> indicadorPreguntaCollection) {
        this.indicadorPreguntaCollection = indicadorPreguntaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (areCod != null ? areCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AreaIndic)) {
            return false;
        }
        AreaIndic other = (AreaIndic) object;
        if ((this.areCod == null && other.areCod != null) || (this.areCod != null && !this.areCod.equals(other.areCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.AreaIndic[areCod=" + areCod + "]";
    }

}
